package app.ep1.bandejoes;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Spinner;
import app.ep1.R;

public class BandejoesActivity extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.bandejoes);

		Button buttonConfirma = (Button) findViewById(R.id.buttonConfirma);
		buttonConfirma.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				Spinner spinner = (Spinner) findViewById(R.id.spinner);

				String selecionado = spinner.getSelectedItem().toString();

				Bundle bundle = new Bundle();
				bundle.putString("nomeBandejao", selecionado);

				Intent i = new Intent(v.getContext(),
						InformacoesBandejaoActivity.class);
				i.putExtras(bundle);
				v.getContext().startActivity(i);
			}
		});
	}
}